package com.zhifou.controller;

import com.zhifou.entity.UploadFile;
import com.zhifou.service.UploadFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

/**
 * @author 公众号：知否技术
 * @title IndexController
 * @date 2022-9-26 17:02
 * @description TODO
 */
@Controller
public class IndexController {
    @Autowired
    private UploadFileService fileService;

    @GetMapping("/index")
    public String toIndex(Model model) {
        List<UploadFile> list = fileService.list();
        model.addAttribute("fileList",list);
        return "index";
    }
}
